<?php
/**
 * Created by PhpStorm.
 * User: LiuJiaJun
 * Date: 2019/1/13
 * Time: 15:37
 */

namespace api\storage\common;


use api\storage\exception\TypeNotFoundException;
use api\storage\service\inventory\BlackMaterielInventoryService;
use api\storage\service\inventory\BlackShelfInventoryService;
use api\storage\service\inventory\ContainerInventoryService;
use api\storage\service\inventory\WhiteMaterielInventoryService;
use api\storage\service\inventory\WhiteShelfInventoryService;
use think\Exception;

class InventoryFactory
{

    public static function getInventoryService($type){
        switch ($type){
            case 1:
                return new BlackShelfInventoryService();
                break;
            case 12:
                return new WhiteShelfInventoryService();
                break;
            case 2:
                return new ContainerInventoryService();
                break;
            case 3:
                return new BlackMaterielInventoryService();
                break;
            case 32:
                return new WhiteMaterielInventoryService();
                break;
            default:
                throw new TypeNotFoundException();
        }
    }
}